pfuze: Fix unsigned variable for less-than-zero comparison
authorYe.Li <[email protected]>
Mon, 4 Jan 2016 07:26:30 +0000 (15:26 +0800)
committerStefano Babic <[email protected]>
Thu, 7 Jan 2016 16:48:25 +0000 (17:48 +0100)
According to the Coverity result, a unsigned int variable is used fo less-
than-zero comparison, the result is never true. Need to fix the variable
type to signed int.

Signed-off-by: Ye.Li <[email protected]>
Signed-off-by: Peng Fan <[email protected]>
Cc: Przemyslaw Marczak <[email protected]>
Cc: Stefano Babic <[email protected]>
Reviewed-by: Stefano Babic <[email protected]>
board/freescale/common/pfuze.c

index 783c46d882846d1f17e05ce48ed6b32cbca1105f..69afa835623a30109014497a38b94f621df4f7de 100644 (file)
@@ -13,7 +13,8 @@
 int pfuze_mode_init(struct pmic *p, u32 mode)
 {
        unsigned char offset, i, switch_num;
-       u32 id, ret;
+       u32 id;
+       int ret;
 
        pmic_reg_read(p, PFUZE100_DEVICEID, &id);
        id = id & 0xf;